import time

from selenium.webdriver.common.by import By
from zhokao2.page import a3m
from selenium.webdriver.common.keys import Keys
class Pate(a3m):
    ss=(By.XPATH,'/html/body/div[2]/div/div/form/div[1]/input')
    dj=(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/span/a/img')
    sl=(By.XPATH,'//*[@id="store_nums"]')
    jr=(By.XPATH,'//*[@id="add-cart"]')
    go=(By.XPATH,'/html/body/div[3]/div[3]/div[2]/a')
    sp=(By.XPATH,'//*[@id="cart-box"]/div[1]/table/tbody/tr[2]/td[1]/input')
    ljjs=(By.XPATH,'//*[@id="cartForm"]/div[2]/div/a[2]')
    dz=(By.XPATH,'//*[@id="address-3412"]')
    xyb=(By.XPATH,'//*[@id="order-button"]')
    def yy(self):
        time.sleep(5)
        self.send_keys(self.ss,'音乐耳机')
        time.sleep(2)
        self.send_keys(self.ss,Keys.ENTER)
        time.sleep(2)
        self.click(self.dj)
        time.sleep(2)
        self.clear(self.sl)
        time.sleep(2)
        self.send_keys(self.sl,'2')
        time.sleep(2)
        self.click(self.jr)
        time.sleep(2)
        self.click(self.go)
        time.sleep(2)
        self.click(self.sp)
        time.sleep(2)
        self.click(self.ljjs)
        time.sleep(2)
        self.click(self.dz)
        time.sleep(2)

